package cn.masterj.springcloud.controller;

import cn.masterj.springcloud.service.IPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author masterJ
 * @create 2020-04-10 20:35
 */
@RestController
@RequestMapping("/payment")
public class PaymentController {

    @Autowired
    private IPaymentService paymentService;

    @GetMapping("/ok")
    public String payment_ok(){
        return paymentService.payment_ok();
    }

    @GetMapping("/timeout")
    public String payment_timeout() throws InterruptedException {
        return paymentService.payment_timeout();
    }

    @GetMapping("/exception")
    public String payment_exception() {
        return paymentService.payment_exception();
    }

    @GetMapping("/circuit/{id}")
    public String payment_circuit(@PathVariable("id") Long id) {
        return paymentService.payment_circuit(id);
    }
}
